﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Tradex.Connectivity.ConnectorModel;

namespace Tradex.Connectivity.Dummy {
    
    /// <summary>
    /// The DummyConnector is a reference non-operation connector. It implements the complete basic operations, but actually
    /// does not expose any services.
    /// </summary>
    public class DummyConnector : IConnector {

        /// <inheritdoc />
        public void SetCallback(IConnectorCallback callback) {
            _Callback = callback;
        }

        /// <inheritdoc />
        public void Connect(string connectionString) {
            _Callback.StatusUpdate(ConnectionStatusCode.Connected, "Connection established");
            _IsConnected = true;
        }

        /// <inheritdoc />
        public void Disconnect() {
            _Callback.StatusUpdate(ConnectionStatusCode.Disconnected, "Connection terminated");
            _IsConnected = false;
        }

        /// <inheritdoc />
        public bool IsConnected {
            get {
                return _IsConnected;
            }
        }

        /// <inheritdoc />
        public void Dispose() {
        }

        IConnectorCallback _Callback;
        bool _IsConnected = false;

    }

}
